package com.itheima.day07.ZuoYe.ZuoYe1;

import java.util.Scanner;

public class ZuoYe1 {
    public static void main(String[] args) throws NotRightNumber {
        String[] arr = {"高启强", "高启盛", "高玉兰", "高育良", "高小琴", "高明远", "高赫"};
        Scanner sc = new Scanner(System.in);
        String zimu = "qwertyuiopasdfghjklzxcvbnm";
        char[] charArray = zimu.toCharArray();
        while (true) {
            try {
                System.out.println("请输入一个1-7之间的整数：");
                String index = sc.next();
                boolean flag = true;
                boolean flag2 = true;
                for (int i = 0; i < charArray.length; i++) {
                    if (index.contains(charArray[i] + "")) {
                        flag = false;
                        break;
                    }
                }
                if (Integer.parseInt( index) > 7 || Integer.parseInt( index) < 1) {
                    flag2 = false;
                }
                if (flag && flag2) {
                    Integer index1 = Integer.parseInt(index);
                    System.out.println(arr[index1 - 1] + "请开始你的表演！");
                    break;
                } else {
                    throw new NotRightNumber("输入有误，请重试");
                }
            } catch (NotRightNumber e) {
                System.out.println(e.getMessage());
            }
        }


    }
}
